<?php
namespace Destroyer\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Destroyer\Http\Requests\LoginRequest;
use Destroyer\Models\User;

class TokenController extends Controller
{

	/**
	 * 创建Token[登录]
	 */
	public function store(LoginRequest $request)
	{
		// 鉴定用户账号和密码
		$request->authenticate();

		// 生成token
		$token = $request->generateToken();

		// 写登录记录和IP
		// $request->record();

		return response()->admin(['token'=>$token]);
	}


	public function destroy(Request $request)
	{
		// code...
	}
}
